<html>
 
<head>
<HTA:APPLICATION>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<script language="JavaScript">
window.resizeTo(screen.width*0.6,screen.height*0.7);
window.top.moveTo(screen.width/5,screen.height/20);
function getwwA(){	//根据现在天气电码得到相关电码数组和说明数组 ,新的改变
var strww='';
var strsm='';
with(this){

	switch(ww){
	case '06':
		strww='06';
		strsm='观测时有浮尘，广泛散布的浮在空中的尘土，不是在观测时由测站或由测站附近的风所吹起来的';
		
	break;
	case '07':
		strww='07';
		strsm='观测时有由测站或由测站附近的风所吹起来的扬沙或尘土，但还没有发展成完好的尘卷风或沙尘暴；或飞沫吹到观测船上';
	break;
	case '09':
		strww='09';
		strsm='观测时或视区内有沙尘暴，或观测前一小时内在测站有沙尘暴';
	break;
	case '17':
		strww='17';
		strsm='观测时测站没有降水的雷暴';
	break;
	case '18':
		strww='18';
		strsm='观测时或观测前一小时内在测站或视区内出现飑';
	break;
	case '19':
		strww='19';
		strsm='观测时或观测前一小时内在测站或视区内出现龙卷';
	break;
	case '20':
		strww='20';
		strsm='观测前一小时内在测站有毛毛雨（非阵性的）';
	break;
	case '21':
		strww='21';
		strsm='观测前一小时内在测站有雨（非阵性的）';
	break;
	case '22':
		strww='22';
		strsm='观测前一小时内在测站有雪，米雪或冰粒（非阵性的）';
	break;
	case '23':
		strww='23';
		strsm='观测前一小时内在测站有雨夹雪，或雨夹冰粒（非阵性的）';
	break;
	case '24':
		strww='24';
		strsm='观测前一小时内在测站有毛毛雨或雨，并有雨凇结成（非阵性的）';
	break;
	case '25':
		strww='25';
		strsm='观测前一小时内在测站有阵雨';
	break;
	case '26':
		strww='26';
		strsm='观测前一小时内在测站有阵雪，或阵性雨夹雪';
	break;
	case '27':
		strww='27';
		strsm='观测前一小时内在测站有冰雹或霰（伴有或不伴有雨）';
	break;
	case '28':
		strww='28';
		strsm='观测前一小时内在测站有雾';
	break;
	case '29':
		strww='29';
		strsm='观测前一小时内在测站有雷暴（伴有或不伴有降水）';
	break;
	case '30':
		strww='30,31,32,33,34,35';
		strsm='观测时有轻的或中度的沙尘暴，过去一小时内减弱(有效能见度≥0.5千米--＜1.0千米)'
		  +';观测时有轻的或中度的沙尘暴，过去一小时内没有显著的变化(有效能见度≥0.5千米--＜1.0千米)'
		  +';观测时有轻的或中度的沙尘暴，过去一小时内开始或增强(有效能见度≥0.5千米--＜1.0千米)'
		  +';观测时有强的沙尘暴，过去一小时内减弱(有效能见度＜0.5千米)'
		  +';观测时有强的沙尘暴，过去一小时内没有显著的变化(有效能见度＜0.5千米)'
		  +';观测时有强的沙尘暴，过去一小时内开始或增强(有效能见度＜0.5千米)';
	break;
	case '38':
		strww='38,39';
		strsm='观测时有轻的或中度的高吹雪(有效能见度≥1千米)，吹雪所达高度一般高于观测员的眼睛（水平视线）'
		  +';观测时有强的高吹雪(有效能见度＜1千米)，吹雪所达高度一般高于观测员的眼睛（水平视线），或雪暴';	
	break;
	case '42':
		strww='42,43,44,45,46,47';
		strsm='观测时有雾，过去一小时内已变薄，天空可辩明'
		    +';观测时有雾，过去一小时内已变薄，天空不可辩'
		    +';观测时有雾，过去一小时内强度没有显著的变化，天空可辩明'
		    +';观测时有雾，过去一小时内强度没有显著的变化，天空不可辩'
	 	    +';观测时有雾，过去一小时内开始出现或已变浓，天空可辩明'
		    +';观测时有雾，过去一小时内开始出现或已变浓，天空不可辩';
	break;
	case '48':
		strww='48,49';
		strsm='观测时有雾，并有雾凇结成，天空可辩明'
		     +';观测时有雾，并有雾凇结成，天空不可辩';	
	break;
	case '50':
		strww='50,51,52,53,54,55';
		strsm='观测时有间歇性轻毛毛雨(有效能见度≥1.0千米)'
			+';观测时有连续性轻毛毛雨(有效能见度≥1.0千米)'
			+';观测时有间歇性中常毛毛雨(有效能见度≥0.5千米--＜1.0千米)'
			+';观测时有连续性中常毛毛雨(有效能见度≥0.5千米--＜1.0千米)'
			+';观测时有间歇性浓毛毛雨(有效能见度＜0.5千米)'
			+';观测时有连续性浓毛毛雨(有效能见度＜0.5千米)';
			
	break;
	case '56':
		strww='56,57';
		strsm='观测时有轻的毛毛雨，并有雨凇结成(有效能见度≥1.0千米)'
			+';观测时有中常或浓的毛毛雨，并有雨凇结成(有效能见度＜1.0千米)';
	break;
	case '58':
		strww='58,59';
		strsm='观测时有轻毛毛雨夹雨(有效能见度≥1千米)'
			+';观测时有中常或浓的毛毛雨夹雨(有效能见度＜1千米)';
	break;
	case '60':
		strww='60,61,62,63,64,65';
		strsm='观测时有间歇性小雨'
			+';观测时有连续性小雨'
			+';观测时有间歇性中雨'
			+';观测时有连续性中雨'
			+';观测时有间歇性大雨'
			+';观测时有连续性大雨';
		
	break;
	case '66':
		strww='66,67';
		strsm='观测时有小雨，并有雨凇结成'
			+';观测时有中雨或大雨，并有雨凇结成';
	break;
	case '68':
		strww='68,69';
		strsm='观测时有小的雨夹雪，或轻毛毛雨夹雪'
			+';观测时有中常的或大雨夹雪，或中常的或浓的毛毛雨夹雪';
	break;
	case '70':
		strww='70,71,72,73,74,75';
		strsm='观测时有间歇性小雪(有效能见度≥1.0千米)'
			+';观测时有连续性小雪(有效能见度≥1.0千米)'
			+';观测时有间歇性中雪(有效能见度≥0.5千米--＜1.0千米)'
			+';观测时有连续性中雪(有效能见度≥0.5千米--＜1.0千米)'
			+';观测时有间歇性大雪(有效能见度＜0.5千米)'
			+';观测时有连续性大雪(有效能见度＜0.5千米)';
	break;
	case '77':
		strww='77';
		strsm='观测时测站有米雪（伴有或不伴有雾）';
	break;
	case '79':
		strww='79';
		strsm='观测时测站有冰粒';
	break;
	case '80':
		strww='80,81,82';
		strsm='观测时有小的阵雨'
			+';观测时有中常的阵雨'
			+';观测时有大的阵雨';
	break;
	case '83':
		strww='83,84';
		strsm='观测时有小的阵性雨夹雪'
			+';观测时有中常的或大的阵性雨夹雪';
	break;
	case '85':
		strww='85,86';
		strsm='观测时有小的阵雪(有效能见度≥1.0千米)'
			+';观测时有中常或大的阵雪(有效能见度＜1千米)';		
	break;
	case '87':
		strww='87,88';
		strsm='观测时有小的阵性霰，伴有或不伴有雨或雨夹雪'
			+';观测时有中常或大的阵性霰，伴有或不伴有雨或雨夹雪';			
	break;
	case '89':
		strww='89,90';
		strsm='观测时有轻的冰雹，伴有或不伴有雨或雨夹雪'
			+';观测时有中常或强的冰雹，伴有或不伴有雨或雨夹雪';	
	break;
	case '91':
		strww='91,92';
		strsm='观测前一小时内有雷暴，观测时有小雨'
			+';观测前一小时内有雷暴，观测时有中雨或大雨';	
	break;
	case '93':
		strww='93,94';
		strsm='观测前一小时内有雷暴，观测时有小（轻）的雪(有效能见度≥1.0千米)，或雨夹雪，或霰，或冰雹'
			+';观测前一小时内有雷暴，观测时有中常的或大（强）的雪(有效能见度＜1千米)，或雨夹雪，或霰，或冰雹';	

	break;
	case '95':
		strww='95';
		strsm='小或中常的雷暴，观测时没有冰雹、或霰，但有雨、或雪、或雨夹雪';
	break;
	case '96':
		strww='96';
		strsm='小或中常的雷暴，观测时伴有冰雹、或霰';
	break;
	case '97':
		strww='97';
		strsm='大雷暴，观测时没有冰雹、或霰，但有雨、或雪、或雨夹雪';
	break;	
	case '98':
		strww='98';
		strsm='雷暴，观测时伴有沙尘暴和降水';
	break;
	case '99':
		strww='99';
		strsm='大雷暴，观测时伴有冰雹、或霰';
	break;

	}
	wwA=strww.split(",");	//电码数组，用","分隔
	wwSM=strsm.split(";");	//说明数组，用";"分隔
	if(!wwA[0]){wwA[0]=ww;wwSM[0]='';}

}
}

////////////////////// 天气编码类 //////////////////////////
function tqbm(){ 

	 
         this.wwA=new Array();	//电码数组
	 this.wwSM=new Array();	//说明数组
	 this.getwwA=getwwA;	//得到现天数组


	 this.ww='00';	//现天编码
	 this.w1=0;
	 this.w2=0;
	 this.obsmt='';	//观测时间
	 this.gtm6=new Array();	//过去6小时过天电码数组,不包括现天对应码和雷暴之后的降水过天电码
	 this.gtm1f=new Array();//过去1小时前过天电码数组,不包括现天对应码 
	 this.gtjs=new Array();//雷暴之后的降水过天电码数组
	 this.x1=0;	//现天所对应的过天码
	 this.x2=0;
	 this.x3=0;
	 this.st=0;	//过去1小时前开始时间
 	 this.et=0;	//过去1小时前结束时间

	 this.tqxxA=new Array();	//天气现象数组
	 this.obs=new Array();		// 观测时
	 this.obsf=new Array();		//观测前一小时
	 this.obs1=new Array();		//过去一小时
	 this.obs6=new Array();		//过去六小时
	 this.obs1f=new Array();	//过去一小时前

	 this.get_tqxx=get_tqxx;	//添加天气现象数组tqxxA
	 this.set_obsmt=set_obsmt;	//设置观测时间

	this.get_obs=get_obs;	//时间区段划分归类
	this.get_js=get_js;	//过天电码分组

	this.is_obs=is_obs;	//判断是否观测时
	this.is_obsf=is_obsf;	//判断是否观测前一小时
	this.is_obs1f=is_obs1f;	//判断是否过去一小时前	

	this.getww=getww;	//得到现天电码
	this.getw1w2=getw1w2;	//得到过天电码

	this.get_x1x2=get_x1x2;	//得到对应过天电码,,添加x1,x2,x3
	this.ifcf=ifcf;		//现象是否重复
}

//21:07 2008-3-25更新
function obs_sort(obj1,obj2){	//自定义排序函数

	if((obj1.star_t)<(obj2.star_t)) return -1;
	if((obj1.star_t)==(obj2.star_t)) return 0;
	if((obj1.star_t)>(obj2.star_t)) return 1;

}
//--------------------------------------------
function ifcf(gtm){ 	//判断现象是否持续过去时段 (3或6小时)
with(this){
	var tem=0;
	var mst=st+60*1000;	//加一分钟，3小时或6小时时间段。
	var met=et;

	//11:49 2008-3-23更新
	var tm_obs1f = obs1f;		//生成临时对象
	tm_obs1f.sort(obs_sort);	//对过去1小时前时间段出现的现象,根据时间出现的先后顺序做了排序	
	//alert(new Date(tm_obs1f[0].star_t)+"\n"+new Date(tm_obs1f[0].end_t)+"\n"+new Date(tm_obs1f[1].star_t)+"\n"+new Date(tm_obs1f[1].end_t));
	for(var i=0;i<tm_obs1f.length;i++){
		if(tm_obs1f[i].gtdm==gtm){		//如果是此过天现象
			//alert(tm_obs1f[i].gtdm+"\n"+tm_obs1f[i].name);	
			if(tm_obs1f[i].star_t<=mst){ 	//如果此现象开始时间<=时间段开始
				if(tm_obs1f[i].end_t>=met) return 1;	//如此现象开始时间>=时间段结束 
				else tem=tm_obs1f[i].end_t;
			}
			if(tm_obs1f[i].star_t-tem<=30*60*1000){	//如此现象间断30分以内	
				if(tm_obs1f[i].end_t>=met) return 1;
				else tem=tm_obs1f[i].end_t;
			} 
		}

	}
	return 0;
}
}
//----------------------------------------------------------------------------------------------

function getw1w2(){	//得到过天电码	
with(this){

	var x=gtm6.length;

	if(x>=2){	//3.13.6 (2) 有两个或两个以上供编报W1、W2。	
		w1=gtm6[0];
		w2=gtm6[1];		
		return;
	}
	if(x==1){	//3.13.6 (3) //只有一种现象供编过天	
		if(findgtdm(x1,obs1f)){	//如果现象出现在过去1小时前 (i)  雷暴特殊规定ii	
			w1=Math.max(x1,gtm6[0]);
			w2=Math.min(x1,gtm6[0]);
			return;		//如果找到x1,则只用x1加另一种过天码,并退出  (雷暴特殊规定 9或8)		
		}
		if(findgtdm(x2,obs1f)){	//如未找到x1 ,则用x2编报  (雷暴特殊规定 没有9,则用8)	
			w1=Math.max(x2,gtm6[0]);
			w2=Math.min(x2,gtm6[0]);
			return;
		}
		if(findgtdm(x3,obs1f)){	
			w1=Math.max(x3,gtm6[0]);
			w2=Math.min(x3,gtm6[0]);

		}else{		//如果现象出现在过去1小时以内	(ii)
					
			w1=gtm6[0];
			if(ifcf(w1)) w2=w1;
		}	
		return;
	}
	if(x==0){		//3.13.6 (4) 没有其他现象供编过天,如果现象出现在过去1小时前 雷暴特殊规定ii 如
		var y1=0,y2=0,y3=0;
		if(findgtdm(x1,obs1f)) y1=x1;	//过去1小时前找现天过天码
		if(findgtdm(x2,obs1f)) y2=x2;
		if(findgtdm(x3,obs1f)) y3=x3;
		var temp=new Array();
		var i=0;
		if(y1){temp[i]=y1;i++}	//将x1,x2,x3,加入对比数组 9或8加入对比数组	
		if(y2){temp[i]=y2;i++}
		if(y3){temp[i]=y3;i++}

		var ist=0;
		if((is60(obs1f))&&gtjs[0]){ //如果雷暴期间的降水出现在过去一小时前，则将大码加入对比数组
			for(var t=0;t<temp.length;t++){ //遍历temp
				if(gtjs[0]==temp[t]){ist=1; break;}//有重复
			}
			if(!ist) {temp[i]=gtjs[0];i++;}//如果没有重复则加入对比数组
		} 

		temp=temp.reverse(temp.sort());		//数组从大到小排列
		if(temp[0])w1=temp[0];			//从对比数组选出w1,w2	
		if(temp[1])w2=temp[1];
		
		if(ifcf(w1)&&(w2==0)) w2=w1;		//如重复编码

		return;
	}
	if((gtm1f.length)>0&&(x1==0)){ 		//3.13.6 (5) //如果WW=00;过去一小时前有现象
		w1=gtm1f[0];
		if(ifcf(w1)) w2=w1;		//如重复编码
		return;
	}
	
}
}


function get_js(){	//添加过天电码组

with(this){	
	var cf=0;i=0;j=0;
	var tem=0;mt=0;
	var lb=find('17',obs6);	//找雷暴
	if(lb) mt=lb.star_t;	//如果有雷暴，得到雷暴开始时间	
	for(var ojs=0;ojs<obs6.length;ojs++){	//obs6遍历 
		tem=obs6[ojs].gtdm;
		if(tem==0) continue;	//如果为0，跳过
		var w=parseInt(ww,10);
		if((w>=91)||(w==29)||(w==17)){	//如果ww>=91	
			if(is_js(obs6[ojs])){	//如果是降水现象 
				if((obs6[ojs].star_t>=mt)||(obs6[ojs].end_t>=mt)){//如果该降水现象在雷暴开始之后开始或结束 
					var ist=0;
					for(var t=0;t<gtjs.length;t++){  //gtjs遍历
						if(tem==gtjs[t]){ist=1; break;}//有重复
			
					}
					if(ist==0){//如果无重复,追加gtjs数组
						gtjs[j]=tem;
						j++;
					}
					if((obs6[ojs].star_t>=mt)&&(obs6[ojs].end_t>=mt))
					 	//如在雷暴之前也有降水,将此现象加入gtm6	
						continue;//否则只加入gtjs数组
				}			

			}
		}
				
		if(x1&&(tem==x1)) continue;//排除对应过天码
		if(x2&&(tem==x2)) continue;
		if(x3&&(tem==x3)) continue;

		iscf=0;

		for(var tjs=0;tjs<gtm6.length;tjs++){ //gtm6遍历
			if(tem==gtm6[tjs]){iscf=1; break;}//有重复
			
		}
		if(iscf==0){//如果无重复,追加gtm6数组

			gtm6[i]=tem;
			i++;

		}
		
	}
	i=0;
	for(var ojs=0;ojs<obs1f.length;ojs++){  //obs1f遍历
		tem=obs1f[ojs].gtdm;
		if(tem==0) continue;//如果为0，跳过
		if(x1&&(tem==x1)) continue;
		if(x2&&(tem==x2)) continue;
		if(x3&&(tem==x3)) continue;

		iscf=0;

		for(var tjs=0;tjs<gtm1f.length;tjs++){ //gtm1f遍历
			if(tem==gtm1f[tjs]){iscf=1; break;}//有重复
			
		}
		if(iscf==0){//如果无重复,追加gtm6数组

			gtm1f[i]=tem;
			i++;

		}
		
	}
	
	gtjs=gtjs.reverse(gtjs.sort());//雷暴期间的降水码 由大到小排序 
	

	if(((w==29)||(w==17))&&gtjs[0]){ //如果是17,29
		iscf=0;
		var leng=gtm6.length;
		for(var tjs=0;tjs<gtm6.length;tjs++){ //gtm6遍历
			if(gtjs[0]==gtm6[tjs]){iscf=1; break;}//有重复
			
		}
		if(iscf==0){//如果无重复,追加gtm6数组

			gtm6[leng]=gtjs[0];//选一大的降水码加入编报
		}
	
	}
	
	gtm6=gtm6.reverse(gtm6.sort());//过去6小时码 除去x1,x2,x3,和雷暴期间的降水码,但包括雷暴之前的降水码
	gtm1f=gtm1f.reverse(gtm1f.sort());//过去1时码前的码 ,除去x1,x2,x3
	
	
}
}
function getW(str){ //根据现象得到过天码
	var W=0;
	switch(str){
	case '31':
	case '38':
	case '39': W=3;
	break;
	case '42': W=4;
	break;
	case '50': W=5;
	break;
	case '60': W=6;
	break;
	case '68':
	case '70':
	case '77':
	case '79': W=7;
	break;
	case '80':
	case '83':
	case '85':
	case '87': 
	case '89': W=8;
	break;
	case '17': W=9;
	break;
	default:   W=0;
	}
	return W;		

}
function find(w,arry){ //在时段数组中找天气

	for(var i=0;i<arry.length;i++){ if(w==(arry[i].name))  return arry[i];}
	return 0;
}
function findgtdm(w,arry){ //在时段数组中找过天电码

	for(var i=0;i<arry.length;i++){ if(w==(arry[i].gtdm))  return 1;}
	return 0;
}

function is60(w){ //时段数组中是否有降水现象
	var jy=new Array('50','60','68','70','77','79','80','83','85','87','89');
	for(var i=0;i<jy.length;i++)		//不包括雾凇、雨凇、冰针(无起止时间)
		for(var j=0;j<w.length;j++) 
			if(w[j].name==jy[i]) 
				return 1;
	
	return 0;
}
function is_js(w){//现象是否是降水现象
	var jy=new Array('50','60','68','70','77','79','80','83','85','87','89');
	for(var i=0;i<jy.length;i++) //不包括雾凇、雨凇、冰针(无起止时间)
		if(w.name==jy[i]) 
			return 1;
	
	return 0;
}

function getww(){	//得到现天电码
with(this){
		
	var wwtem='00';
	for(var i=0;i<obs1.length;i++){
		
		
		
		switch(obs1[i].name){
		case '06':
			
			if(find('06',obs)) wwtem='06';//浮尘
			
		break;
		case '07':
			if(find('07',obs)) wwtem='07';//扬沙
		break;
		case '17'://现天有雷暴
		
			if( !is60(obs) ){	//现天没有降水
				if(find('17',obs))  wwtem='17';	//现天有雷暴
				else		    wwtem='29';	//过天有雷暴
				
			}
			else{					
				if(find('17',obs)){	  	
				
					if( (!find('89',obs))&&(!find('87',obs))&&(!find('15',obs)) )
					 	 wwtem='95';	
					if( ((find('89',obs))||(find('87',obs)))&&(!find('15',obs)) )
					  	 wwtem='96'; 
					if( (!find('89',obs))&&(!find('87',obs))&&(find('15',obs)) )
					 	 wwtem='97';	
					if( (find('31',obs)) )
					  	 wwtem='98';	
					if( ((find('89',obs))||(find('87',obs)))&&(find('15',obs)) )
					  	 wwtem='99';	
				
				}
				else{		//过天有雷暴		
					
					if( (!find('70',obs))&&(!find('68',obs))&&(!find('87',obs))&&(!find('89',obs)) )
					 	 wwtem='91';
					if( (find('70',obs))||(find('68',obs))||(find('87',obs))||(find('89',obs)) )
					 	 wwtem='93';
				}
			}
		break;
		case '18':wwtem='18';//飑
		break;
		case '19':wwtem='19';//龙卷
		break;
		case '31':
			if(find('31',obs)) wwtem='30';//30-35 观测时有沙尘暴
			else wwtem='09';//观测前1小时内有沙尘暴
		break;
		case '38':
			if(find('38',obs)) wwtem='38';//38-39 观测时有吹雪
		break;
		case '39':
			if(find('39',obs)) wwtem='39';//观测时有雪暴
		break;
		case '42':
			if(find('42',obs)){ //观测时有雾
				if(find('48',obs))//观测时有雾凇
					wwtem='48';
				else
					wwtem='42';
			}
			else{		//观测前1小时有雾   
				wwtem='28';
			}
		break;
		case '50'://毛毛雨,未考虑58,69毛毛雨夹雨
			if(find('50',obs)){ //观测时有毛毛雨
				if(find('56',obs)) //有雨凇
					wwtem='56';//50-57
				else
					wwtem='50';//50-55
			}
			else{ //观测前1小时有毛毛雨
				if(find('56',obsf)) //有雨凇
					wwtem='24';
				else
					wwtem='20';
			}
		break;
		case '60':
			if(find('60',obs)){ //观测时有雨
				if(find('56',obs)) //有雨凇
					wwtem='66';//66-67
				else
					wwtem='60';//60-65
			}
			else{ //观测前1小时有雨
				if(find('56',obsf)) 
					wwtem='24';//有雨凇
				else
					wwtem='21';
			}
		break;
		case '68':
			if(find('68',obs)) //观测时有雨夹雪
				wwtem='68';
			else
				wwtem='23';
		break;
		case '70':
			if(find('70',obs)) //观测时有雨夹雪
				wwtem='70';
			else
				wwtem='22';
		break;
		case '77'://米雪
			if(find('77',obs))
				wwtem='77';
			else
				wwtem='22';
		break;
		case '79':
			if(find('79',obs))
				wwtem='79';
			else
				wwtem='22';
		break;
		case '80':
			if(find('80',obs))
				wwtem='80';
			else
				wwtem='25';
		break;
		case '83':
			if(find('83',obs))
				wwtem='83';
			else
				wwtem='26';
			
		break;
		case '85':
			if(find('85',obs))
				wwtem='85';
			else
				wwtem='26';
		break;
		case '87':
			if(find('87',obs))
				wwtem='87';
			else
				wwtem='27';
		break;
		case '89':
			if(find('89',obs))
				wwtem='89';
			else
				wwtem='27';			
		break;


		}
		
		
		var tmp1=parseInt(wwtem,10);
		var tmp2=parseInt(ww,10);
		
		if((tmp1==17||tmp1==18||tmp1==19)&&((tmp2<=49)&&(tmp2>=20)))
				ww=wwtem;
		else 	
			if(!((tmp2==17||tmp2==18||tmp2==19)&&((tmp1<=49)&&(tmp1>=20))))//如是20-49,不能替换17,18,19
				if(tmp1>tmp2) ww=wwtem;
			

	}
}
	this.get_x1x2();	//得到现天对应过天码,添加x1,x2,x3
	this.get_js();	//添加过天电码组
	this.getwwA();

}
function get_x1x2(){	//得到现天对应过天码
	
	var x=parseInt(this.ww,10);
	
	if ((x==9)||(x>=30&&x<=35)||(x==38)||(x==39)){ this.x1=3;return;}
	if ((x==28)||(x>=42&&x<=49)){ this.x1=4;return;}
	if ((x==20)||(x>=50&&x<=57)){ this.x1=5;return;}
	if ((x==21)||(x>=60&&x<=67)){ this.x1=6;return;}
	if ((x==22)||(x==23)||(x==68)||(x==69)||(x>=70&&x<=75)||(x==77)||(x==79)){ this.x1=7;return;}
	if ((x>=25&&x<=27)||(x>=80&&x<=90)){ this.x1=8;return;}
	if ((x==17)||(x==29)){ this.x1=9;return;}
	
	if((x==24)||(x==58)||(x==59)){ this.x1=6;this.x2=5;return;}
	if ((x>=91&&x<=97)||(x==99)){ this.x1=9;this.x2=8;return;}
	if (x==98){ this.x1=9;this.x2=8;this.x3=3;return;}
}
function set_obsmt(str){	//设置观测时间
	this.obsmt=str;	//观测时间
	this.get_obs();	//添加天气现象组
}
function get_obs(){	//填写各时间段
with(this){
	var js1=js2=js3=0;
	for(var i=0;i<tqxxA.length;i++){
		if(is_obs(tqxxA[i]))  {obs[js1]=tqxxA[i];js1++;}
		if(is_obsf(tqxxA[i])) {obsf[js2]=tqxxA[i];js2++;}
		if(is_obs1f(tqxxA[i])){obs1f[js3]=tqxxA[i];js3++;}
	}	
	obs1=obs.concat(obsf);
	obs6=obs1.concat(obs1f);


//11:47 2008-3-23更新  ??????????????
//	obs.sort(obs_sort);
//	obsf.sort(obs_sort);
//	obs1f.sort(obs_sort);
//	obs1.sort(obs_sort);	
//	obs6.sort(obs_sort);
	
}
}
//-----------------------------------------------------

function tqxx(str){	//天气现象类

	this.name=str;	//代码名称
	this.gtdm=0;	//过天电码
	this.star_t=9999;//开始时间
	this.end_t=9999;//结束时间
	this.zzbj=0;//设转标记
	this.get_star_t=get_star_t;//得到开始时间
	this.get_end_t=get_end_t;//得到结束时间

}

function get_obs_t(str){ //得到标准时间
	 var mt = new Date();
	 var d=2;		//日期
	 var h=str.substr(0,2); //时
	 var m=str.substr(2,2); //分
	
	 mt.setHours(h,m,0,0);  
	 if((str-0)>2000) d=1;  	//如果>20时00分,日期减1, 20时(02,08,14,20)观测判断和现象结束时间判断60 1758-2000通过 <=20为今天
	 mt.setFullYear(2000,01,d); 

	 return mt.getTime();
}

function get_star_t(str){  //得到现象开始时间

	 var mt=get_obs_t(str);
	 if((str-0)==2000) 
		mt-=24*3600*1000;//如果是20时整,日期减1  如: 60 2000-2300/
	 this.star_t=mt;

}
function get_end_t(str){ //得到现象结束时间

	 var mt=get_obs_t(str);
 	 if(this.zzbj) 
		mt-=60*1000;//如果是转现象则，结束时间-1分钟
	 this.end_t=mt;

}

function is_obs(obj){ //是否观测时


	if(obj.star_t==9999) return 0;//如果现象无时间

	var ost=obj.star_t;//记录开始时间
	var oet=obj.end_t;//记录结束时间
	var et=get_obs_t(this.obsmt+"00");//结束时间
	var st;//开始时间
	
	switch(this.obsmt){
	case "02":
	case "05":
	case '08':
	case '11':
	case '14':
	case '17':
	case '20':
	case '23':
		st=et-15*60*1000;	//45分开始
	break;
	default:
		st=et-10*60*1000;	//50分开始
	}

	return (((ost>st)&&(ost<=et))||((oet>st)&&(oet<=et))|| ((ost<=st)&&(oet>=et)) );
}
function is_obsf(obj){ //是否观测前1小时

	if(obj.star_t==9999) return 0;	//如果现象无时间

	var ost=obj.star_t;//记录开始时间
	var oet=obj.end_t;//记录结束时间
	var st=get_obs_t(this.obsmt+"00")-3600*1000;//开始时间
	var et;//结束时间
	
	switch(this.obsmt){
	case "02":
	case "05":
	case '08':
	case '11':
	case '14':
	case '17':
	case '20':
	case '23':
		et=st+45*60*1000;	//45分结束
	break;
	default:
		et=st+50*60*1000;	//50分结束
	}

	return (((ost>st)&&(ost<=et))||((oet>st)&&(oet<=et))|| ((ost<=st)&&(oet>=et)) );
}

function is_obs1f(obj){ //是否过去1小时前

	var str=this.obsmt;

	if(obj.star_t==9999) return 0;//如果现象无时间

	var ost=obj.star_t;//记录开始时间
	var oet=obj.end_t;//记录结束时间
	var mt=get_obs_t(str+"00");//正点时
	var st;
	var et=mt-3600*1000;//结束时间
	if(str=="17"||str=="05"||str=="11"||str=="23")
		st=mt-3*3600*1000;//开始时间
	else
		st=mt-6*3600*1000;//开始时间

	this.st=st;
	this.et=et;
	return (((ost>st)&&(ost<=et))||((oet>st)&&(oet<=et))|| ((ost<=st)&&(oet>=et)) );
}


function get_tqxx(inp){  //分析输入字符串,得到天气现象对象
	
with(this){
   
	var tem=new Array();
	var tem2=new Array();
	var str=inp.substr(input.value.indexOf("\)")+1);//屏蔽掉()符号，转换夜间观测内容
	
	tem=str.split("/");

	var bj=0;	//连续天气现象标记
        var js=0;	//天气现象对象记数
	for(var j=0;j<tem.length;j++){ 
		
		tem2=tem[j].split(" ");

		for(var i=0;i<tem2.length;i++){	//分解现象和时间 
			
			if(tem2[i].charAt(0)==".") break;
			
			if(i==0){	//如果是 "80"形式 
				 tqxxA[js]=new tqxx(tem2[i]);//增加一现象
				 tqxxA[js].gtdm=getW(tem2[i]);
				 js++;			
			}
			if(i==1){	//如果是时间段"1200-1456"形式
				tqxxA[js-1].get_star_t(tem2[i].substr(0,4));
				if(bj==1){ tqxxA[js-2].get_end_t(tem2[i].substr(0,4));bj=0;}	//如果上一现象为转现象，遇到标记
  			        if(tem2[i].substr(tem2[i].length-1,1)=="-") {bj=1;tqxxA[js-1].zzbj=1;}	//设转标记
				else  tqxxA[js-1].get_end_t(tem2[i].substr(5,4));	
				if(tem2[i].length==4) tqxxA[js-1].end_t=tqxxA[js-1].star_t;	//一分钟以内
				
			}
			if(i>1){	//如果是时间段"1500-1745 1200-1456"形式
	    			 tqxxA[js]=new tqxx(tqxxA[js-1].name);
				 tqxxA[js].gtdm=getW(tqxxA[js].name);
				 tqxxA[js].get_star_t(tem2[i].substr(0,4));
				 if(tem2[i].substr(tem2[i].length-1,1)=="-"){ bj=1;tqxxA[js].zzbj=1;}//设转标记
				 else	tqxxA[js].get_end_t(tem2[i].substr(5,4));	
				 if(tem2[i].length==4) tqxxA[js].end_t=tqxxA[js].star_t;//一分钟以内 
				 js++;	
				
			}
			
		}
	}
	
}

}
///////////////////////////////////// 天气现象类定义部分结束   ////////////////////////////////////
</script>

<title>天气现象</title>
<style>
<!--
.t1          { text-align: center; 
               border-top-style: dotted; border-top-width: 1;cursor:default }
.t2          { text-align: center;  border-right-style: dotted; 
               border-right-width: 1; border-top-style: dotted; 
               border-top-width: 1;cursor:default }
.t3          { text-align: center; font-family: WeatherSymbol;font-size:18px; 
				border-top-style: dotted; border-top-width: 1;cursor:default }

-->
</style>
</head>

<body scroll="no" onload=fonload() onunload=fonunload()>
<div align="center"><center>

<table border="0" cellspacing="0" cellpadding="0" width="481" height="457">
  <tr>
    <td width="475" height="240" colspan="7">
<div id="zhk2" style="width: 470; height: 209" style="display:none"></div>
<div id="zhk" style="width: 470; height: 209"><table id="tab"
    onclick="mytab()" border="0" cellspacing="0" cellpadding="0"
    style="border-style: dotted; border-width: 1" width="470" height="192">
      <tr>
        <td class="t3" title=" 01 " width="39" height="21" nowrap><small>
              
        </small>        
        </td>
        <td class="t1" title=" 01 " width="39" height="21" nowrap><small>露</small></td>
        <td class="t2" title=" 01 " width="39" height="21" nowrap><small>01</small></td>
        <td class="t3" title=" 13 " width="39" height="21" nowrap>        
                
        </td>
        <td class="t1" title=" 13 " width="39" height="21" nowrap><small>闪电</small></td>
        <td class="t2" title=" 13 " width="39" height="21" nowrap><small>13</small></td>
        <td class="t3" title=" 39 " width="39" height="21" nowrap>        
                
        </td>
        <td class="t1" title=" 39 " width="39" height="21" nowrap><small>雪暴</small></td>
        <td class="t2" title=" 39 " width="39" height="21" nowrap><small>39</small></td>
        <td class="t3" title=" 77 " width="39" height="21" nowrap>        
                
        </td>
        <td class="t1" title=" 77 " width="40" height="21" nowrap><small>米雪</small></td>
        <td class="t2" title=" 77 " width="40" height="21" nowrap><small>77</small></td>
      </tr>
      <tr>
        <td class="t3" title=" 02 " width="39" height="21" nowrap>        
                
        </td>
        <td class="t1" title=" 02 " width="39" height="21" nowrap><small>霜</small></td>
        <td class="t2" title=" 02 " width="39" height="21" nowrap><small>02</small></td>
        <td class="t3" title=" 14 " width="39" height="21" nowrap>        
                
        </td>
        <td class="t1" title=" 14 " width="39" height="21" nowrap><small>极光</small></td>
        <td class="t2" title=" 14 " width="39" height="21" nowrap><small>14</small></td>
        <td class="t3" title=" 42 " width="39" height="21" nowrap>        
                
        </td>
        <td class="t1" title=" 42 " width="39" height="21" nowrap><small>雾</small></td>
        <td class="t2" title=" 42 " width="39" height="21" nowrap><small>42</small></td>
        <td class="t3" title=" 79 " width="39" height="21" nowrap>        
                
        </td>
        <td class="t1" title=" 79 " width="40" height="21" nowrap><small>冰粒</small></td>
        <td class="t2" title=" 79 " width="40" height="21" nowrap><small>79</small></td>
      </tr>
      <tr>
        <td class="t3" title=" 03 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 03 " width="39" height="22" nowrap><small>结冰</small></td>
        <td class="t2" title=" 03 " width="39" height="22" nowrap><small>03</small></td>
        <td class="t3" title=" 15 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 15 " width="39" height="22" nowrap><small>大风</small></td>
        <td class="t2" title=" 15 " width="39" height="22" nowrap><small>15</small></td>
        <td class="t3" title=" 48 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 48 " width="39" height="22" nowrap><small>雾凇</small></td>
        <td class="t2" title=" 48 " width="39" height="22" nowrap><small>48</small></td>
        <td class="t3" title=" 80 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 80 " width="40" height="22" nowrap><small>阵雨</small></td>
        <td class="t2" title=" 80 " width="40" height="22" nowrap><small>80</small></td>
      </tr>
      <tr>
        <td class="t3" title=" 04 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 04 " width="39" height="22" nowrap><small>烟幕 </small></td>
        <td class="t2" title=" 04 " width="39" height="22" nowrap><small>04</small></td>
        <td class="t3" title=" 16 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 16 " width="39" height="22" nowrap><small>积雪</small></td>
        <td class="t2" title=" 16 " width="39" height="22" nowrap><small>16</small></td>
        <td class="t3" title=" 50 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 50 " width="39" height="22" nowrap><small>毛毛雨</small></td>
        <td class="t2" title=" 50 " width="39" height="22" nowrap><small>50</small></td>
        <td class="t3" title=" 83 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 83 " width="40" height="22" nowrap><small>阵雨雪</small></td>
        <td class="t2" title=" 83 " width="40" height="22" nowrap><small>83</small></td>
      </tr>
      <tr>
        <td class="t3" title=" 05 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 05 " width="39" height="22" nowrap><small>霾</small></td>
        <td class="t2" title=" 05 " width="39" height="22" nowrap><small>05</small></td>
        <td class="t3" title=" 17 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 17 " width="39" height="22" nowrap><small>雷暴</small></td>
        <td class="t2" title=" 17 " width="39" height="22" nowrap><small>17</small></td>
        <td class="t3" title=" 56 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 56 " width="39" height="22" nowrap><small>雨凇</small></td>
        <td class="t2" title=" 56 " width="39" height="22" nowrap><small>56</small></td>
        <td class="t3" title=" 85 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 85 " width="40" height="22" nowrap><small>阵雪</small></td>
        <td class="t2" title=" 85 " width="40" height="22" nowrap><small>85</small></td>
      </tr>
      <tr>
        <td class="t3" title=" 06 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 06 " width="39" height="22" nowrap><small>浮尘 </small></td>
        <td class="t2" title=" 06 " width="39" height="22" nowrap><small>06</small></td>
        <td class="t3" title=" 18 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 18 " width="39" height="22" nowrap><small>飑</small></td>
        <td class="t2" title=" 18 " width="39" height="22" nowrap><small>18</small></td>
        <td class="t3" title=" 60 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 60 " width="39" height="22" nowrap><small>雨</small></td>
        <td class="t2" title=" 60 " width="39" height="22" nowrap><small>60</small></td>
        <td class="t3" title=" 87 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 87 " width="40" height="22" nowrap><small>霰</small></td>
        <td class="t2" title=" 87 " width="40" height="22" nowrap><small>87</small></td>
      </tr>
      <tr>
        <td class="t3" title=" 07 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 07 " width="39" height="22" nowrap><small>扬沙 </small></td>
        <td class="t2" title=" 07 " width="39" height="22" nowrap><small>07</small></td>
        <td class="t3" title=" 19 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 19 " width="39" height="22" nowrap><small>龙卷</small></td>
        <td class="t2" title=" 19 " width="39" height="22" nowrap><small>19</small></td>
        <td class="t3" title=" 68 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 68 " width="39" height="22" nowrap><small>雨夹雪</small></td>
        <td class="t2" title=" 68 " width="39" height="22" nowrap><small>68</small></td>
        <td class="t3" title=" 89 " width="39" height="22" nowrap></td>
        <td class="t1" title=" 89 " width="40" height="22" nowrap><small>冰雹</small></td>
        <td class="t2" title=" 89 " width="40" height="22" nowrap><small>89</small></td>
      </tr>
      <tr>
        <td class="t3" title=" 08 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 08 " width="39" height="22" nowrap><small>尘卷风 </small></td>
        <td class="t2" title=" 08 " width="39" height="22" nowrap><small>08</small></td>
        <td class="t3" title=" 31 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 31 " width="39" height="22" nowrap><small>沙尘暴</small></td>
        <td class="t2" title=" 31 " width="39" height="22" nowrap><small>31</small></td>
        <td class="t3" title=" 70 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 70 " width="39" height="22" nowrap><small>雪</small></td>
        <td class="t2" title=" 70 " width="39" height="22" nowrap><small>70</small></td>
        <td class="t3" width="39" height="22" nowrap>　</td>
        <td class="t1" width="40" height="22" nowrap>　</td>
        <td class="t2" width="40" height="22" nowrap>　</td>
      </tr>
      <tr>
        <td class="t3" title=" 10 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 10 " width="39" height="22" nowrap><small>轻雾 </small></td>
        <td class="t2" title=" 10 " width="39" height="22" nowrap><small>10</small></td>
        <td class="t3" title=" 38 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 38 " width="39" height="22" nowrap><small>吹雪</small></td>
        <td class="t2" title=" 38 " width="39" height="22" nowrap><small>38</small></td>
        <td class="t3" title=" 76 " width="39" height="22" nowrap>        
                
        </td>
        <td class="t1" title=" 76 " width="39" height="22" nowrap><small>冰针</small></td>
        <td class="t2" title=" 76 " width="39" height="22" nowrap><small>76</small></td>
        <td class="t3" width="39" height="22" nowrap>　</td>
        <td class="t1" width="40" height="22" nowrap>　</td>
        <td class="t2" width="40" height="22" nowrap>　</td>
      </tr>
    </table>
    </div></td>
  </tr>
  <tr>
    <td width="475" height="75" valign="middle" colspan="7"><small>观测时间:<input type="text" id="sd" size="2">时</small> <br>
    <textarea rows="3" id="input" cols="65" onfocus="fview()" onkeydown="fkey()"
    style="background-color: rgb(238,238,238);text-transform: uppercase" name=" zzzzzz"></textarea> 
      </td>               
  </tr>               
  <tr>
    <td width="96" height="34" valign="middle">
      <p align="center"><small>
    <input type="button" value="  编码  " name="change" onclick="zh()"></small></td>               
</center>
    <td width="112" height="34" valign="middle">
      <p align="left"><small><input type="button"              
    value="编报全天" onclick="zhall()"></small></td>               
    <td width="77" height="34" valign="middle" align="center"><small> 
      输入方式：</small></td>               

    <td width="22" height="34" valign="middle" align="center">
      <p align="right"><small><input type="radio" id=ahdos value="V1" checked name="R1" onclick="input.value=OStoAH(input.value);input.focus();"></small></p>
  </td>               
    <td width="44" height="34" valign="middle" align="center">
      <p align="left"><small>AHDM</small></td>               

    <td width="29" height="34" valign="middle" align="center">
      <p align="right"><input type="radio" value="V1" id=ossmo  name="R1" onclick="input.value=AHtoOS(input.value);input.focus();"></p>
  </td>               
    <td width="100" height="34" valign="middle" align="center">
      <p align="left"><small>OSSMO</small></td>               
</tr>
<center>

  <tr>               
    <td width="475" height="108" colspan="7"><p align="center"><small>
	<br><br>            
    绥化市北林区气象局<br>               
    翟向东编写<br>               
    2005年06月<br>               
    </small></td>               
  </tr>               
</table>               
</center></div>               
</body>               
<script language="JavaScript">                       
                       
	var view=new Date();         
	sd.value=view.getHours()+1;                       
	if(sd.value>23)sd.value=0;                       
	if(sd.value.length<2)sd.value='0'+sd.value; //填写观测时间
	input.focus();                       
                     
function zhall(){      //转换全天现象               
                     
	var end=input.value.substr(input.value.length-1,1);//加结束标记  

	if(ahdos.checked==1)endcode="/";else endcode=",";

	if((!(end=='/'||end=='.'||end==','))&&end) input.value+=endcode;                       
	
	data=input.value;
	if(ossmo.checked==1) data=OStoAH(input.value);	        

             
	var out='';                     
	var mmt=new Array('21','22','23','00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20');                     
	var myA=new Array();                     
	for(var i=0;i<=23;i++)	myA[i]=new tqbm;  //生成24个天气编码对象                  
	                     
for(var j=0;j<=23;j++){                     
	                     
	                     
	(myA[j]).get_tqxx(data); //输入天气编码                
	(myA[j]).set_obsmt(mmt[j]); //设置观测时间               
                     
	(myA[j]).getww();                     
	out=out+'\n  '+mmt[j]+'时: ';	                     
	switch(mmt[j]){                     
		case '02':                     
		case '05':                     
		case '08':                     
		case '11':                     
		case '14':                     
		case '17':                     
		case '20':                     
		case '23':                     
			myA[j].getw1w2();                     
			for(var i=0;i<((myA[j]).wwA).length;i++)                     
				out+=(myA[j].wwA)[i]+(myA[j]).w1+''+(myA[j]).w2+'  ';                     
		break;                     
		default:                     
			for(var i=0;i<((myA[j]).wwA).length;i++)                     
				out+=((myA[j]).wwA)[i]+'  ';                     
	}                     
	                     
	delete myA[j];                     
                     
}                     
	var tem1="<textarea rows='13'  cols='65' READONLY style='background-color: rgb(238,238,238)' >";                     
	var tem2="</textarea>";               
	zhk.style.display="none";                     
	zhk2.style.display="";                 
	zhk2.innerHTML=tem1+out+tem2;		                     
                     
}                     
function zh(){   //得到当前正点天气现象编报                   
                     
	var end=input.value.substr(input.value.length-1,1);//加结束标记 

	if(ahdos.checked==1)endcode="/";else endcode=",";

	if((!(end=='/'||end=='.'||end==','))&&end) input.value+=endcode;                     
                     
	if(sd.value.length<2)sd.value='0'+sd.value;    //标准化观测时间              
        
	data=input.value;
	if(ossmo.checked==1) data=OStoAH(input.value);	        
                     
	var out='';                     
	var mytq=new tqbm;        //生成天气编码对象          
                     
	mytq.get_tqxx(data);      //输入天气编码             
	mytq.set_obsmt(sd.value); //设置观测时间                  
                     
	mytq.getww();                     
	                     
	                     
	switch(sd.value){                     
		case '02':                     
		case '05':                     
		case '08':
		case '11':                                          
		case '14':                     
		case '17':                     
		case '20':                     
		case '23':                     
			mytq.getw1w2();                     
			for(var i=0;i<(mytq.wwA).length;i++)                     
				out+='<tr><td valign=\'top\'><small><b>'+mytq.wwA[i]+mytq.w1+''+mytq.w2+'</b></small></td>   <td><small> '+mytq.wwSM[i]+'</small><td> </tr>';                     
		break;                     
		default:                     
			for(var i=0;i<(mytq.wwA).length;i++)                     
				out+='<tr><td valign=\'top\'><small><b>'+mytq.wwA[i]+'</b></td>   </small><td><small> '+mytq.wwSM[i]+'</small><td> </tr>';                     
	}                     
                     
	zhk.style.display="none";                     
	zhk2.style.display="";                 
	zhk2.innerHTML='<table>'+out+'</table>';                     
               
	delete mytq;                     
	                     
	                     
}                     
function fkey(){      //处理回车键
	if(event.keyCode==0x0D) {                
		               
		zh();          //回车开始编码                    
		zhk2.focus();               
	}               
	                     
}                     
function andbj(){  //加分隔符               
	var end=input.value.substr(input.value.length-1,1);                     
	if(ahdos.checked==1)endcode="/";else endcode=",";
	if(end!='/'&&end!=','&&end)input.value+=endcode;                     
}                     
                     
function mytab(){    //加现象代码                  
                     
	var str;               
	input.focus();                     
	andbj();               
	var name=window.event.srcElement.tagName;               
               
	str=window.event.srcElement.title;               
	if(name=="SMALL")               
		str=window.event.srcElement.parentElement.title;               
	//if(name=="IMG")               
	//	str=window.event.srcElement.parentElement.parentElement.title;               
               
	var bm=parseInt(str,10);               
	if(bm<10)bm='0'+bm;               
	if(bm==bm) input.value+=bm;                     
}                     
                     
function fview(){          //恢复现象代码提示表           
	zhk2.style.display="none";                  
	zhk.style.display="";                     
}                     
function fonload(){

//////////////////访问注册表，可删除此段
	var WSHShell = new ActiveXObject("WScript.Shell");
	try{
		input.value=WSHShell.RegRead("HKCU\\Software\\zxd\\w1w2\\data");		
	}
	catch(e){
		WSHShell.RegWrite("HKCU\\Software\\zxd\\w1w2\\data","");
		WSHShell.RegWrite("HKCU\\Software\\zxd\\w1w2\\mode","AHDOS");
	}
	var mode=WSHShell.RegRead("HKCU\\Software\\zxd\\w1w2\\mode");
	if(mode=="AHDOS"){ ahdos.checked=1;ossmo.checked=0;}
	else { ahdos.checked=0;ossmo.checked=1;}
//////////////////访问完毕 	    		
	
}                       
function fonunload(){

//////////////////写入注册表，可删除此段
	var WSHShell = new ActiveXObject("WScript.Shell");
	WSHShell.RegWrite("HKCU\\Software\\zxd\\w1w2\\data",input.value);
	if(ahdos.checked==1) mode="AHDOS";else mode="OSSMO";
	WSHShell.RegWrite("HKCU\\Software\\zxd\\w1w2\\mode",mode);
////////////////写入完毕

} 
   
function AHtoOS(str){	//AH格式到OSSMO格式

	tem=str.split("/");
	for(var i=0;i<tem.length;i++){
		var re = / /;
  		tem[i] = tem[i].replace(re, "M");
	} 
	str=tem.join(",");
	var re = / /g;
  	str = str.replace(re, "'");
	var re = /M/g;
  	str = str.replace(re, " ");
	return str;	

}
function OStoAH(str){	//OSSMO格式到AH格式
	var re = /'/g;
  	str = str.replace(re, " ");
	var re = /,/g;
  	str = str.replace(re, "/");	
	var re = /;/g;
  	str = str.replace(re, "");	

	return str; 
}                   
</script>               
               
</html>               
